package com.xmutca.sso.api.manager.service;

import com.xmutca.core.common.Receipt;
import com.xmutca.core.common.Result;
import com.xmutca.core.common.Results;
import com.xmutca.sso.api.Menu;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.List;
import java.util.Map;

/**
 * @author: 彭伟煌(pengweihuang@xmutca.com)
 * @create: 2016-08-26 16:42
 */
public interface MenuService {

    /**
     *  菜单创建
     * @param menu
     * @return
     */
    Receipt add(Menu menu);

    /**
     * 删除菜单
     * @param menuId
     * @return
     */
    Receipt del(Integer menuId);

    /**
     * 批量删除
     * @param menuIds
     * @return
     */
    Receipt batchDel(List<Integer> menuIds);

    /**
     * 更新菜单
     * @param menu
     * @return
     */
    Receipt update(Menu menu);

    /**
     * 读取菜单
     * @param menuId
     * @return
     */
    Result<Menu> get(Integer menuId);

    /**
     * 查询菜单
     * @param current
     * @param pageSize
     * @param paramMap
     * @return
     */
    Results<Menu> query(@Min(value = 1, message = "页数最小为1") int current, @Max(value = 50, message = "条数最大为50条") int pageSize, Map<String, Object> paramMap);
}
